#Importing local files....
import compile_vPath_dissector
import compile_make_commands
import dir_fxns
import initiator

#-----------------------------------------------------------------------
#initiator.py file's methods tested below.........

def input_arguments_check():
    list_args=["test","bv"]
    retcode=initiator.arg_check(len(list_args))
    assert retcode==0, "\"Input_arguments_check\" test fails. Errorcode:\
 %d" % retcode
    print "\"Input_arguments_check\" test passes successfully........"

#----------------------------------------------------------------------
#compile_make_commands.py file's methods tested below.........

def clean_dist_check():
    curr_dir="/home/rahul"
    os.chdir(curr_dir)
    retcode=compile_make_commands.clean_dist()
    assert retcode ==0, 'Error occured in \"make dist clean\" command \
in directory %s. ErrorCode: %d' % (curr_dir,retcode)
    print "Successful execution of \"make dist clean\" command"
    
def configure_with_prefix_check():
    path_binaries=""
    code_dir=""
    path_logs=""
    exec_env=""
    retcode=compile_make_commands.configure_with_prefix(
        path_binaries,
        code_dir,
        path_logs,
        exec_env)
    assert retcode==0, "\"Configure_with_prefix_check\" fails. \
Errorcode: %d" % retcode
    print "\"Configure_with_prefix_check\" passes successfully........."

def make_check():
    code_dir=""
    path_logs="/home/rahul"
    exec_env=""
    retcode=compile_make_commands.make(code_dir,path_logs,exec_env)
    assert retcode==0, '\"make_check\" fails. Errorcode is: %d' % retcode
    print "\"make_check\" passes successfully......."
    
def make_install_check():
    code_dir=""
    path_logs=""
    exec_env=""
    retcode=compile_make_commands.make_install(code_dir,path_logs,exec_env)
    assert retcode==0, '\"make_install_check\" fails. \
Errorcode is: %d' % retcode
    print "\"make_install_check\" passes successfully......."
    
#---------------------------------------------------------------------
#dir_fxns.py file's methods tested below.........

def make_dir_check():
    path="/home/rahul/test"
    dir_retcode=dir_fxns.mkdir_p(path)
    assert dir_retcode==0, '\"make_dir_check\" fails. Errorcode: %d'\
 % dir_retcode
    print "\"make_dir_check\" test passes successfully.........."
    
def list_dir_check():
    path="/testssd"
    retcode=dir_fxns.listdir_check(path)
    assert retcode!=-1001, '\"List_dir_check\" on %s directory failed!!!'\
 % path

#--------------------------------------------------------------------

if __name__=="__main__":
    #************initiator.py file check.....................
    #input_arguments_check()
    
    #************compile_make_command.py file check...................
    #clean_dist_check()
    #configure_with_prefix_check()
    #make_check()
    #make_install_check()
    
    #************dir_fxns file check..................
    make_dir_check()
    #list_dir_check()
    print "Yes its working...."

#---------------------------------------------------------------------
    
